package com.xxd.rpt2.service.impl

import com.xxd.rpt2.Entity.Department
import com.xxd.rpt2.repository.DepartmentRepository
import com.xxd.rpt2.service.DepartmentService
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service

@Service
class DepartmentImpl implements DepartmentService{
    @Autowired
    DepartmentRepository departmentRepository
    @Override
    Department getById(int id) {
        return departmentRepository.getOne(id)
    }

    @Override
    List<Department> findAll() {
        return departmentRepository.findAll()
    }
}
